using System.ComponentModel;

namespace SumerCoreDevOps.Application.Dtos.Requests.GitTriggers
{
    /// <summary>
    /// 创建 Git 触发规则请求
    /// </summary>
    public class CreateGitTriggerRuleRequest
    {
        /// <summary>
        /// 关联的工作流ID
        /// </summary>
        /// <example>1</example>
        [Description("关联的工作流ID")]
        public long WorkflowId { get; set; }

        /// <summary>
        /// 触发规则名称
        /// </summary>
        /// <example>Main Branch Push Trigger</example>
        [Description("触发规则名称")]
        public string Name { get; set; } = null!;

        /// <summary>
        /// 触发类型（Push, Tag, PullRequest等）
        /// </summary>
        /// <example>Push</example>
        [Description("触发类型")]
        public string TriggerType { get; set; } = null!;

        /// <summary>
        /// 分支匹配模式（可选，支持通配符）
        /// </summary>
        /// <example>main</example>
        [Description("分支匹配模式")]
        public string? BranchPattern { get; set; }

        /// <summary>
        /// 标签匹配模式（可选，支持通配符）
        /// </summary>
        /// <example>v*</example>
        [Description("标签匹配模式")]
        public string? TagPattern { get; set; }

        /// <summary>
        /// 路径过滤器（可选，支持通配符）
        /// </summary>
        /// <example>src/**</example>
        [Description("路径过滤器")]
        public string? PathFilter { get; set; }
    }

    /// <summary>
    /// 更新 Git 触发规则请求
    /// </summary>
    public class UpdateGitTriggerRuleRequest
    {
        /// <summary>
        /// 触发规则名称
        /// </summary>
        /// <example>Main Branch Push Trigger</example>
        [Description("触发规则名称")]
        public string Name { get; set; } = null!;

        /// <summary>
        /// 触发类型（Push, Tag, PullRequest等）
        /// </summary>
        /// <example>Push</example>
        [Description("触发类型")]
        public string TriggerType { get; set; } = null!;

        /// <summary>
        /// 分支匹配模式（可选，支持通配符）
        /// </summary>
        /// <example>main</example>
        [Description("分支匹配模式")]
        public string? BranchPattern { get; set; }

        /// <summary>
        /// 标签匹配模式（可选，支持通配符）
        /// </summary>
        /// <example>v*</example>
        [Description("标签匹配模式")]
        public string? TagPattern { get; set; }

        /// <summary>
        /// 路径过滤器（可选，支持通配符）
        /// </summary>
        /// <example>src/**</example>
        [Description("路径过滤器")]
        public string? PathFilter { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        /// <example>true</example>
        [Description("是否启用")]
        public bool IsEnabled { get; set; }
    }
}
